<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<style>
  .box {
    position: relative;
    margin: 20px  ;
  }
  .box .img{
    background-color: #ff4933;
    height: 200px;
    width: 200px;
  }
  .box i{
    position: absolute;
    left: -15px;
  }
</style>
<body>
<div class="box">
  <i class="close">x</i>
  <div class="img"></div>
</div>
<script>
  var box = document.querySelector('.box');
  var close = document.querySelector('.close');

  close.onclick = function () {
    box.style.display = 'none';
  }
</script>
</body>
</html>